Enable file locking support for Hurd
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 16 Dec 2025 10:45:36 +0000 (11:45 +0100)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Sun, 8 Mar 2026 10:11:47 +0000 (11:11 +0100)
like Illumos in #148322, Hurd was missed when originally introducing locking
gates per target OS in #132977. building rustc on Hurd was broken as a result
since 1.91.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name Enable-file-locking-support-for-Hurd.patch

library/std/src/fs/tests.rs
library/std/src/sys/fs/unix.rs

index 0517760c35501b2cd493b56f6983c4b1029fdc2e..6e897281962b8a3bc458f015ad641b970d1e8cee 100644 (file)
@@ -226,6 +226,7 @@ fn file_test_io_seek_and_write() {
 #[cfg(any(
     windows,
     target_os = "freebsd",
+    target_is = "hurd",
     target_os = "linux",
     target_os = "netbsd",
     target_os = "solaris",
@@ -251,6 +252,7 @@ fn file_lock_multiple_shared() {
 #[cfg(any(
     windows,
     target_os = "freebsd",
+    target_is = "hurd",
     target_os = "linux",
     target_os = "netbsd",
     target_os = "solaris",
@@ -277,6 +279,7 @@ fn file_lock_blocking() {
 #[cfg(any(
     windows,
     target_os = "freebsd",
+    target_is = "hurd",
     target_os = "linux",
     target_os = "netbsd",
     target_os = "solaris",
@@ -300,6 +303,7 @@ fn file_lock_drop() {
 #[cfg(any(
     windows,
     target_os = "freebsd",
+    target_os = "hurd",
     target_os = "linux",
     target_os = "netbsd",
     target_os = "solaris",
index 3efe67390d7dd9e3afa0289b6a242b45c4ba509d..df03fb560483a1e0c593ff405a3c746d0eccb2a1 100644 (file)
@@ -1288,6 +1288,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1312,6 +1313,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1327,6 +1329,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1351,6 +1354,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1366,6 +1370,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1406,6 +1411,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1424,6 +1430,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1464,6 +1471,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1482,6 +1490,7 @@ impl File {
     #[cfg(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
@@ -1506,6 +1515,7 @@ impl File {
     #[cfg(not(any(
         target_os = "freebsd",
         target_os = "fuchsia",
+        target_os = "hurd",
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",